Skip to content

Conversation

YanDevDe
Copy link

In order to use Vue 3 Plugins, you need to import Vue3Plausible instead of VuePlausible

import { createApp, reactive } from 'vue'
import {Vue3Plausible} from "vue-plausible

const app = createApp(App)
app.use(Vue3Plausible, {
    domain: "<domain>"
    //..other configurations
});";

The typing may need some working as well. Temporarly I used //@ts-ignore here since most of the typings is still using Vue 2 instead from Vue 3. Any Pull Request at my side is welcome.

This is just a quick solution for people who need Vue 3 support right now.

@YanDevDe YanDevDe mentioned this pull request Jan 10, 2022
@YanDevDe
Copy link
Author

Also I removed lib in .gitignore - so then it can be directly used per npm i https://github.com/YanDevDe/vue-plausible for temporary solution.

@@ -13,6 +13,8 @@ const defaultOptions: PlausibleModuleOptions = {
}

const PlausibleModule: Module<PlausibleModuleOptions> = function (moduleOptions) {
if (!this) return;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was receiving error by using Vue 3 because "this" didn't existed here. I didn't even used Nuxt here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant